﻿@model IEnumerable<NC.Data.Address>

<script type="text/javascript">
    $(function () {
     $("#locations a").click(function () {
         $.ajax({
             url: "post/ViewNeededPosts?stateId=" + $(this).attr("id")+"&stateName=",
             type: 'GET',
             cache: false,
             success: function (result) {
                 $('#neededposts').html(result);
             }
         });
         $.ajax({
             url: "post/ViewAvailablePosts?stateId=" + $(this).attr("id")+"&stateName=",
             type: 'GET',
             cache: false,
             success: function (result) {
                 $('#availableposts').html(result);
             }
         });
         return false;
     });
 });
</script>

<div class="list-group" id="locations">
<h5 class="list-group-item active">Locations</h5>
@if (Model != null)
{
    foreach (var item in Model)
    {
        <a id="@item.State.Id" class="list-group-item">@item.State.StateName</a>
    }
}
</div>